import config


class ApproveTrustApi:

    # 初始化
    def __init__(self, session):
        self.session = session

    # 实名认证接口
    def approve_api(self,data):
        url = config.Host+"/member/realname/approverealname"
        resp = self.session.post(url=url,data=data,files={"x":"y"})
        return resp


    # 获取认证信息
    def get_approve_status(self):
        url=config.Host+"/member/member/getapprove"
        resp = self.session.post(url=url)
        return resp

    # 开户
    def trust_api(self):
        url = config.Host+"/trust/trust/register"
        resp = self.session.post(url=url)
        return resp

    # 获取充值验证码
    def get_verify_code(self,r):
        url = config.Host+f"/common/public/verifycode/{r}"
        print("url=",url)
        resp = self.session.get(url=url)
        return resp

    # 充值
    def recharge_api(self,data):
        url = config.Host+"/trust/trust/recharge"

        headers = {"Content-Type": "application/x-www-form-urlencoded"}
        resp = self.session.post(url=url,headers=headers,data=data)
        return resp
